#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#define file_path "/dev/ChenGreenKeyDeviceName"

int main(int argc, char* argv[])
{
	int error = -20;
	int key_status = 0;

	int fd = open(file_path, O_RDWR);

	do {
		read(fd, &key_status, sizeof(key_status));
		usleep(100000);
	} while (0 == key_status);

	close(fd);
	return 0;
}
